import axios from 'axios'

const movieModule = {
  namespaced: true,
  state () {
    return {
      movieList: []
    }
  },
  mutations: {
    updateMovieList (state, payload) {
      state.movieList = payload
    }
  },
  actions: {
    async  getMovieList ({ commit }) {
      const res = await axios.get('http://test.zjie.wang/api/hot')
      console.log(res)
      commit('updateMovieList', res.data.hot)
    }

  }
}

export default movieModule
